{include file='public:header-css'/}
<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        {include file='public:left-menu'/}
        <!--End 左侧导航-->
        <!--头部信息-->
        {include file='public:nav-header' title="店铺管理" subTitle="申请提现"/}
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header form-header"><h4>申请提现</h4></div>
                            <div class="card-body">
                                <div class="reminder">
                                    <div class="tit"><i class="mdi mdi-information-outline"></i>温馨提示</div>
                                    <div class="reminder-info">
                                        <span class="reminder-link">提现{if $cash.ye_tx_sxf>0}手续费{$cash.ye_tx_sxf}%{else/}无手续费{/if}</span>
                                        {if $cash.ye_tx_min>0}<span class="reminder-link">提现金额{$cash.ye_tx_min}元起</span>{/if}
                                        {if $cash.ye_tx_xishu>0}<span class="reminder-link">提现金额为{$cash.ye_tx_xishu}元的整数倍</span>{/if}
                                        {if $cash.ye_tx_num>0}<span class="reminder-link">每日可提现{$cash.ye_tx_num}次</span>{/if}
                                    </div>
                                </div>
                                <form method="post" id="submit-form" class="row">
                                    <div class="form-group col-md-12">
                                        <label class="form-title">可用资金</label>
                                        <div class="form-inline">
                                            <div class="item">
                                                <span>我的粮票</span>
                                                <span>{$user.user_money}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <label class="form-title">提现金额</label>
                                        <input type="text" class="form-control" name="money" placeholder="请输入提现金额"/>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <label class="form-title">提现方式</label>
                                        <div>
                                            {if $is_wx_bind==1}
                                            <label class="radio-inline" for="example-inline-radio1">
                                                <input type="radio" {if $temp_tx_type==1}checked{/if} id="example-inline-radio1" name="tx_type" value="1">
                                                微信
                                            </label>
                                            {/if}
                                            {if $is_zfb_bind==1}
                                            <label class="radio-inline" for="example-inline-radio2">
                                                <input type="radio" {if $temp_tx_type==2}checked{/if} id="example-inline-radio2" name="tx_type" value="2">
                                                支付宝
                                            </label>
                                            {/if}
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        {if $cash.cash_open==0}
                                        <button type="button" disabled class="btn-theme submit-btn">提现未开放</button>
                                        {else/}
                                        <button type="button" class="btn-theme submit-btn">确定</button>
                                        {/if}
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <!--End 页面主要内容-->
    </div>
</div>
<style>
    .form-inline .item{
        margin-right: 5px;
    }
    .form-inline .item span:last-child{
        color: var(--red);
    }
</style>
<script type="text/javascript">
    $(function () {
        $('.submit-btn').click(function () {
            var url = "{:url('Store/withdraw')}";
            var data = $('#submit-form').serialize();
            public_ajax(url,data,function (data) {
                if (data.code == 1) {
                    showSuccessMsg(data.msg, function () {
                        if (data.data.url) {
                            location.href = data.data.url;
                        }
                    });
                }  else {
                    showErrorMsg(data.msg);
                }
            });
        });
    });
</script>
</body>
</html>
